package base.service;

import base.bean.Seckill;
import base.bean.dto.Exposer;
import base.bean.dto.SeckillExecution;
import base.bean.exception.RepeatKillException;
import base.bean.exception.SeckillException;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by 30509 on 2018/3/25.
 */
@Service
public interface SeckillService {

    List<Seckill> getSeckillList();

    Seckill getById(long seckillId);

    /**
     * 秒杀开启是输出秒杀接口地址
     * 否则输出系统时间和秒杀时间
     * @param seckillId
     * @return
     */
    Exposer exportSeckillUrl(long seckillId);

    /**
     * 执行秒杀操作
     * @param seckillId
     * @param userPhone
     * @param md5
     */
    SeckillExecution executeSeckill (long seckillId, long userPhone, String md5)
            throws SeckillException,RepeatKillException,SeckillException;
}
